<template>
  <div class="loading-html" v-show="state">
    <!--<div class="loader"></div>-->
    <div class="loading-fixed">
      <div class='loader loader--snake'></div>
    </div>
  </div>
</template>

<script>
  export default {
    name: `load`,
    props: {
      state: Boolean
    },
    watch: {},
    methods: {
    }
  }
  ;
</script>

<style lang="stylus" rel="stylesheet/stylus">
  @import "../../../assets/stylus/main.styl"
  .loading-html {
    width: 100%;
    height: 100;
    position: absolute;
    background: #fff;
    z-index: 99999;
    transition: all 0.5s;
    -webkit-transition: all 0.5s;
  }

  .loading-fixed {
    width: 100%;
    height: 100%;
    position: fixed;
    background: #fff;
    z-index: 99999;
  }

  .loader {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    margin: auto;
  }

  .loader--snake {
    width: 3em;
    height: 2em;
    background: linear-gradient(#923df0, #923df0) 0 50%, linear-gradient(#923df0, #923df0) 0.625em 50%, linear-gradient(#923df0, #923df0) 1.25em 50%, linear-gradient(#923df0, #923df0) 1.875em 50%, linear-gradient(#923df0, #923df0) 2.5em 50%;
    background-repeat: no-repeat;
    background-size: 0.5em 0.25em, 0.5em 0.25em, 0.5em 0.25em, 0.5em 0.25em, 0.5em 0.25em;
    animation: snake 1.5s linear infinite;
  }

  @-webkit-keyframes snake {
    25% {
      background: linear-gradient(#923df0, #923df0) 0 50%, linear-gradient(#923df0, #923df0) 0.625em 50%, linear-gradient(#923df0, #923df0) 1.25em 50%, linear-gradient(#923df0, #923df0) 1.875em 50%, linear-gradient(#923df0, #923df0) 2.5em 50%;
      background-repeat: no-repeat;
      background-size: 0.5em 2em, 0.5em 0.25em, 0.5em 0.25em, 0.5em 0.25em, 0.5em 0.25em;
    }
    37.5% {
      background: linear-gradient(#923df0, #923df0) 0 50%, linear-gradient(#923df0, #923df0) 0.625em 50%, linear-gradient(#923df0, #923df0) 1.25em 50%, linear-gradient(#923df0, #923df0) 1.875em 50%, linear-gradient(#923df0, #923df0) 2.5em 50%;
      background-repeat: no-repeat;
      background-size: 0.5em 0.25em, 0.5em 2em, 0.5em 0.25em, 0.5em 0.25em, 0.5em 0.25em;
    }
    50% {
      background: linear-gradient(#923df0, #923df0) 0 50%, linear-gradient(#923df0, #923df0) 0.625em 50%, linear-gradient(#923df0, #923df0) 1.25em 50%, linear-gradient(#923df0, #923df0) 1.875em 50%, linear-gradient(#923df0, #923df0) 2.5em 50%;
      background-repeat: no-repeat;
      background-size: 0.5em 0.25em, 0.5em 0.25em, 0.5em 2em, 0.5em 0.25em, 0.5em 0.25em;
    }
    62.5% {
      background: linear-gradient(#923df0, #923df0) 0 50%, linear-gradient(#923df0, #923df0) 0.625em 50%, linear-gradient(#923df0, #923df0) 1.25em 50%, linear-gradient(#923df0, #923df0) 1.875em 50%, linear-gradient(#923df0, #923df0) 2.5em 50%;
      background-repeat: no-repeat;
      background-size: 0.5em 0.25em, 0.5em 0.25em, 0.5em 0.25em, 0.5em 2em, 0.5em 0.25em;
    }
    75% {
      background: linear-gradient(#923df0, #923df0) 0 50%, linear-gradient(#923df0, #923df0) 0.625em 50%, linear-gradient(#923df0, #923df0) 1.25em 50%, linear-gradient(#923df0, #923df0) 1.875em 50%, linear-gradient(#923df0, #923df0) 2.5em 50%;
      background-repeat: no-repeat;
      background-size: 0.5em 0.25em, 0.5em 0.25em, 0.5em 0.25em, 0.5em 0.25em, 0.5em 2em;
    }
  }
</style>
